package com.example.demo.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo.dao.ISchoolCodeDao;
import com.example.demo.model.SchoolCode;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SchoolCodeImpl implements SchoolCodeService {
    private SqlSessionFactory sqlSessionFactory;

    @Autowired
    public void SchoolCodeService(SqlSessionFactory sqlSessionFactory) {
        this.sqlSessionFactory = sqlSessionFactory;
    }

    public SchoolCodeImpl(SqlSessionFactory sqlSessionFactory) {
        this.sqlSessionFactory = sqlSessionFactory;
    }

    @Autowired()
    private ISchoolCodeDao schoolCodeDao;

    @Override
    public List<SchoolCode> GetAllList() {
        return this.schoolCodeDao.selectList(new QueryWrapper<>());
    }

    @Override
    public Integer AddSchoolCode(SchoolCode sc) {
        return this.schoolCodeDao.insert(sc);
    }

    @Override
    public Integer UpdateSchoolCode(com.example.demo.model.SchoolCode data) {
        return null;
    }

    @Override
    public Integer DeleteRecord(Integer id) {
        return null;
    }
}
